<template>
  <el-pagination
    background
    layout="total, prev, pager, next"
    :current-page.sync="currentPage"
    :page-size="pageSize"
    :total="count"
    @current-change="handleCurrentChange">
  </el-pagination>
</template>
<script>
export default {
  data () {
    return {
      currentPage: 1
    }
  },
  props: {
    count: {
      type: Number,
      default: 0
    },
    pageSize: {
      type: Number,
      default: 10
    }
  },

  methods: {
    handleCurrentChange (page) { // 点击页码事件，通知父组件
      this.$emit('pageEvent', this.currentPage)
    }
  }
}
</script>

<style>

</style>
